// const mongoose = require('mongoose')
// const db = mongoose.createConnection('mongodb://localhost:27017/yike');
// db.on('error', console.error.bind(console, 'error'));
// db.once('open', () => {
//     console.info('连接数据库成功')
// })

const mysql = require('mysql')
const db = mysql.createPool({
    host: '127.0.0.1',
    user: 'root',
    password: 'zhu370710',
    database: 'mydb01'
})
// let sqlstr = `SELECT * FROM mydb01.friendschema inner join userschema on userId=?&&state=?&& friendschema.friendId = userschema._id ORDER BY friendschema.lastTime DESC;`
// // let sqlstr = `select * from friendschema  where userId=?&&state=? `
// // // let req = { name: '笑容', age: '11' }
// db.query(sqlstr, ['50af474a78a69b0ef8d9', 0], (err, res1) => {
//     console.log(res1);


// })

module.exports = db